<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JS函数</title>
</head>
<body>
<p>带有参数的call()方法</p>
<p id="demo"></p>

<script>
  var person = {
    fullName: function(city, country) {
      return this.firstName + " " + this.lastName + "," + city + "," + country;
    }
  }
  var person1 = {
    firstName:"Bill",
    lastName: "Gates"
  }
  var person2 = {
    firstName:"Steve",
    lastName: "Jobs"
  }
  var x = person.fullName.call(person1, "Seatle", "USA");
  document.getElementById("demo").innerHTML = x;
</script>
</body>
</html>